package it.webrules.deploymanager.core.st.scm;

import java.util.Formatter;

public class StatusEntry {

	public String path;
	public long workingRevision;
	public long lastChangedRevision;
	public String author;
	public String pathChangeType;
	public String propertiesChangeType;
	public boolean isLocked;
	public boolean isAddedWithHistory;
	public boolean isSwitched;
	public String lockLabel;
	public String remoteChangeType;

	@Override
	public String toString() {

		Formatter formatter = new Formatter();

		String col1 = pathChangeType + propertiesChangeType + (isLocked ? "L" : " ") + (isAddedWithHistory ? "+" : " ")
				+ (isSwitched ? "S" : " ") + lockLabel + "  " + remoteChangeType + "  ";

		formatter.format("%-7s | %7s | %7s | %15s | %s", col1, workingRevision == -1 ? "" : workingRevision, lastChangedRevision == -1 ? ""
				: lastChangedRevision, author == null ? "" : author, path);

		return formatter.toString();
	}
}
